import { _decorator, Component, Node } from 'cc';
import { WzqPlayer } from './WzqPlayer';
import { Color } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('WzqMapItem')
export class WzqMapItem extends Component {
    private labelNode: Node;

    protected onLoad(): void {
        this.labelNode = this.node.Child("label");
        this.labelNode.active = false;
    }

    public downPiece(isMe: boolean) {
        this.labelNode.Label(isMe ? "O" : "X", {
            color: isMe ? Color.BLUE : Color.RED
        });

        this.labelNode.active = true;
    }

    public reset() {
        this.labelNode.active = false;
    }
}
